import java.util.Arrays;

public class Test15 {
    public static void main(String[] args) {
        int[] a = {1,2,3,4,5,6,7};
        System.out.println(Arrays.toString(a));
        for (int i = 0,j = a.length-1; j > i ; i++,j--) {
            int temp;
            if (a[i] != a[j]){
                temp = a[i];
                a[i] = a[j];
                a[j] = temp;
            }
        }
        System.out.println(Arrays.toString(a));
    }
}
